package com.yeyks.app.controller.base.config;

import com.yeyks.app.annotation.LoadUserId;
import com.yeyks.common.ajax.AjaxResponseBody;
import com.yeyks.commonReference.pojo.param.RechargeConfigListParam;
import com.yeyks.commonReference.service.config.RechargeConfigService;
import com.yeyks.config.dto.RechargeConfigDTO;
import com.yeyks.consumer.param.MemberCardTypeParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author fuchangshuai
 * @date 2019/3/26 4:27 PM
 */
@Api(tags = "充值金额接口", description = "充值金额(token放入请求头中，名字为headerToken)")
@Slf4j
@RestController
@RequestMapping(value = "/app/recharge/config")
public class RechargeConfigController {

    @Autowired
    private RechargeConfigService rechargeConfigService;

    /**
     * 获取会员充值金额
     *
     * @return
     */
    @ApiOperation(value = "获取会员充值金额v3.8.1", notes = "获取会员充值金额")
    @PostMapping(value = "/list")
    public AjaxResponseBody<List<RechargeConfigDTO>> list(@LoadUserId RechargeConfigListParam param) {
        List<RechargeConfigDTO> rechargeConfigList = rechargeConfigService.list(param.getUserId(), param.getCardType());
        return AjaxResponseBody.success(rechargeConfigList);
    }

}
